const withdraw = {
    index: true,
    border: true,
    stripe: true,
    menuAlign: 'center',
    loadingText: "加载中...",
    loadingSpinner: "svg",
    loadingSvgViewBox: "-10, -10, 50, 50",
    loadingBackground: "rgba(122, 122, 122, 0.6)",
    labelWidth: 120,
    menu: true,
    menuWidth: 120,
    addBtn: false,
    delBtn: false,
    editBtn: false,
    column: [
        {
            label: "订单号",
            prop: "orderId",
            minWidth: 100,
            search: true
        },
        {
            label: '用户ID',
            prop: 'userId',
            minWidth: 60,
            search: true
        },
        {
            label: '提现渠道',
            prop: 'channel',
            minWidth: 50
        },
        {
            label: '提现时间',
            prop: 'updatedAt',
            minWidth: 100,
            formatter: (row, value, column) => {
                return formatDate(row.updatedAt * 1000, '-')
            }
        },
        {
            label: '提现金额',
            prop: 'souAmount',
            minWidth: 50,
            formatter: (row, value, column) => {
                return row.souAmount/100
            }
        },
        {
            label: '计税额',
            prop: 'calcAmount',
            minWidth: 50,
            formatter: (row, value, column) => {
                return row.calcAmount/100
            }
        },
        {
            label: '个税',
            prop: 'personalTax',
            minWidth: 50,
            formatter: (row, value, column) => {
                return row.serviceTax /100
            }
        },
        {
            label: '手续费',
            prop: 'serviceTax',
            minWidth: 50,
            formatter: (row, value, column) => {
                return row.personalTax/100
            }
        },
    
        {
            label: '实际打款',
            prop: 'amount',
            minWidth: 50,
            formatter: (row, value, column) => {
                return row.amount / 100
            }
        },
        {
            label: '状态',
            prop: 'status',
            minWidth: 100,
            search: true,
            searchType: "select",
            dicData: [
                {
                    label: '已申请',
                    value: 1
                },
                {
                    label: '已通过',
                    value: 2
                },
                {
                    label: '已拒绝',
                    value: 3
                },
                {
                    label: '已打款',
                    value: 4
                },
                {
                    label: '已失败',
                    value: 5
                },
            ],
            formatter: (row, value, column) => {
                if(row.status == 1){
                    return '已申请'
                }else if(row.status == 2){
                    return '已通过'
                }else if(row.status == 3){
                    return '已拒绝'
                }else if(row.status == 4){
                     return '已打款'
                }else{
                     return '失败'
                }
            }
        }
    ],
}

const formatDate = (date, cut) => {
    var date = new Date(date);
    var YY = date.getFullYear() + cut;
    var MM =
        (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + cut;
    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var hh = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
    var mm = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
    var ss = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    return YY + MM + DD + " " + hh + mm + ss;
};

export default withdraw